<template>
    <div class="flex bottomBox">
        <div class="boxShadow wifiComponent">
            <el-form  class="wifiForm">
                <el-form-item prop="name" class="">
                    <div class=" formItem">
                        <div class="itemRight"><input type="text" placeholder="请输入场景名称" v-model="mapName"></div>
                    </div>
                </el-form-item>

                <div class="flex formBtns">
                    <el-button size="small" type="primary" @click="subMap">提交</el-button>
                </div>
            </el-form>
        </div>
    </div>
</template>

<script>
import { Message } from 'element-ui'
import { DATA } from '../js/data'
import { NAV, checkStr } from '../js/navigation'
import { addNewMap } from '../js/methods'

export default {
    name: 'addMapComponent',
    components:{

    },
    data(){
        return{
           mapName:''
        }
    },
    methods:{
        //提交新建地图
        subMap:function(){
            const that = this;
            this.$store.commit('switchShowMask',false);
            this.$store.commit('setNowMapName',that.mapName);
            try{
                addNewMap(that.mapName);
            }catch(err){
                console.log(err)
            }
            
        }
    },

    //属性监听
    watch:{
       
    }

}
</script>

<style scoped lang="less">
 .wifiComponent{
     width: 100%;
     background-color: #ffffff;
     border-top-left-radius: 4px;
     border-top-right-radius: 4px;
     padding: 10px;
     text-align: left;
     font-size: 14px;
 }
 .boldTitle{
     font-weight: bold;
     margin-bottom: 7px;
 }
 .formItem{
    padding: 10px 0;
     border-bottom: 1px solid #eeeeee;

    .itemRight{
        input{
            width: 100%;
            height: 100%;
            display: block;
        }
    }
 }
 .formBtns{
     padding: 0 5px;
     margin-top: 15px;
     button{
         width: 100%;
     }
 }
 .el-form-item{
     margin-bottom: 0;
 }
 .wifiForm div{
    line-height:normal;
 }
 
  .el-form-item__content{
        line-height: 20px;
    }
</style>